!function(t, e) {
    "object" == typeof exports && "object" == typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define([], e) : "object" == typeof exports ? exports.Slardar = e() : t.Slardar = e()
}("undefined" != typeof self ? self : this, function() {
    return function(t) {
        function e(o) {
            if (n[o])
                return n[o].exports;
            var r = n[o] = {
                i: o,
                l: !1,
                exports: {}
            };
            return t[o].call(r.exports, r, r.exports, e),
                r.l = !0,
                r.exports
        }
        var n = {};
        return e.m = t,
            e.c = n,
            e.d = function(t, n, o) {
                e.o(t, n) || Object.defineProperty(t, n, {
                    configurable: !1,
                    enumerable: !0,
                    get: o
                })
            }
            ,
            e.n = function(t) {
                var n = t && t.__esModule ? function() {
                        return t.default
                    }
                    : function() {
                        return t
                    }
                ;
                return e.d(n, "a", n),
                    n
            }
            ,
            e.o = function(t, e) {
                return Object.prototype.hasOwnProperty.call(t, e)
            }
            ,
            e.p = "",
            e(e.s = 1)
    }([function(t, e) {
        function n(t) {
            return "object" == typeof t && null !== t
        }
        function o(t) {
            return "function" == typeof t
        }
        function r(t) {
            return "[object String]" === Object.prototype.toString.call(t)
        }
        function a(t) {
            return "[object Array]" === Object.prototype.toString.call(t)
        }
        function i(t) {
            return "[object Date]" === Object.prototype.toString.call(t)
        }
        function s(t) {
            return void 0 === t
        }
        function c(t, e) {
            return Object.prototype.hasOwnProperty.call(t, e)
        }
        function u(t, e) {
            var n, o;
            if (s(t.length))
                for (n in t)
                    c(t, n) && e.call(null, n, t[n]);
            else if (o = t.length)
                for (n = 0; n < o; n++)
                    e.call(null, n, t[n])
        }
        function f(t) {
            for (var e in t)
                if (t.hasOwnProperty(e))
                    return !1;
            return !0
        }
        function l(t) {
            for (var e, n = [], o = 0, a = t.length; o < a; o++)
                e = t[o],
                    r(e) ? n.push(e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1")) : e && e.source && n.push(e.source);
            return new RegExp(n.join("|"),"i")
        }
        function p(t) {
            var e = document.createElement("a");
            e.href = t;
            var n = e.pathname || "/";
            return "/" !== n[0] && (n = "/" + n),
                {
                    protocol: e.protocol.slice(0, -1),
                    hostname: e.hostname,
                    pathname: n
                }
        }
        function d(t) {
            var e = [];
            return u(t, function(t, n) {
                e.push(encodeURIComponent(t) + "=" + encodeURIComponent(n))
            }),
                e.join("&")
        }
        function h() {
            return +new Date
        }
        function m(t) {
            var e = t.offsetTop;
            return null !== t.offsetParent && (e += m(t.offsetParent)),
                e
        }
        function g() {
            return window.innerHeight ? window.innerHeight : document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight : void 0
        }
        t.exports = {
            isObject: n,
            isFunction: o,
            isString: r,
            isArray: a,
            isDate: i,
            each: u,
            isEmptyObject: f,
            joinRegExp: l,
            urlParser: p,
            urlencode: d,
            now: h,
            getOffsetTop: m,
            getWinHeight: g
        }
    }
        , function(t, e, n) {
            t.exports = n(2)
        }
        , function(t, e, n) {
            var o = n(3)
                , r = new o;
            t.exports = r
        }
        , function(t, e, n) {
            function o() {
                this._baseParams = {},
                    this._globalOptions = {
                        sampleRate: 1,
                        domain: _,
                        hookFetch: !1,
                        enableSizeStats: !1
                    },
                    this.recordCtx = {
                        __firstScreenLoadEndTime: 0
                    }
            }
            var r = n(4)
                , a = n(5)
                , i = n(7)
                , s = n(8)
                , c = n(0)
                , u = c.isObject
                , f = c.isArray
                , l = c.each
                , p = c.isEmptyObject
                , d = c.urlencode
                , h = c.joinRegExp
                , m = c.now
                , g = ["h", "/", "u", "a", "co"]
                , _ = g[0] + "ttps:/" + g[1] + "m.to" + g[2] + "ti" + g[3] + "o." + g[4] + "m";
            o.prototype = {
                VERSION: "1.0.1",
                install: function(t) {
                    var e = this
                        , n = e._baseParams
                        , o = e._globalOptions
                        , c = t.hookFetch || !1
                        , l = t.enableSizeStats || !1;
                    if (_ = t.domain || _,
                        o.ignoreStatic = ["/log/sentry/"],
                        o.ignoreAjax = ["/log/sentry/"],
                        o.domain = _,
                        o.hookFetch = c,
                        o.enableSizeStats = l,
                    e._baseEnvCheck() && u(t) && !p(t) && t.bid && t.pid) {
                        n.version = this.VERSION,
                            n.bid = t.bid,
                            n.pid = t.pid,
                            n.hostname = window.location.hostname,
                            n.protocol = window.location.protocol.slice(0, -1),
                            o.sampleRate = t.sampleRate || 1;
                        for (var d = ["ignoreStatic", "ignoreAjax"], m = 0, g = d.length; m < g; m++) {
                            var y = d[m]
                                , v = t[y];
                            f(v) && (o[y] = o[y].concat(v)),
                                o[y] = !!o[y].length && h(o[y])
                        }
                        a.start(this.recordCtx),
                            i.start(function() {
                                e._send.apply(e, arguments)
                            }, this.recordCtx),
                            r.start(function() {
                                e._send.apply(e, arguments)
                            }, o.ignoreStatic),
                            s.start(function() {
                                e._send.apply(e, arguments)
                            }, o.ignoreAjax, {
                                fetch: c,
                                size: l
                            })
                    }
                },
                sendCustomTimeLog: function(t, e, n) {
                    if (t) {
                        var o = {
                            ev_type: "custom",
                            cm_name: t,
                            cm_type: "time"
                        };
                        e && (o.cm_tag = e),
                        +n && (o.cm_value = +n,
                            this._send(o, !0))
                    }
                },
                sendCustomCountLog: function(t, e) {
                    if (t) {
                        var n = {
                            ev_type: "custom",
                            cm_name: t,
                            cm_type: "count"
                        };
                        e && (n.cm_tag = e),
                            this._send(n, !0)
                    }
                },
                _send: function(t, e) {
                    var n = this._globalOptions
                        , o = this._paramsPack(t);
                    o && ("number" == typeof n.sampleRate ? Math.random() < n.sampleRate && this._makeRequest(o, e) : this._makeRequest(o, e))
                },
                _makeRequest: function(t, e) {
                    var n = new Image
                        , o = _ + (e ? "/log/sentry/v2/api/slardar/custom/?" : "/log/sentry/v2/api/slardar/main/?");
                    n.src = o + t
                },
                _paramsPack: function(t) {
                    return !u(t) || p(t) ? null : (l(this._baseParams, function(e, n) {
                        t[e] = n
                    }),
                        t.timestamp = m(),
                        d(t))
                },
                _baseEnvCheck: function() {
                    return !!window.addEventListener
                }
            },
                t.exports = o
        }
        , function(t, e, n) {
            var o = n(0)
                , r = o.urlParser
                , a = {
                start: function(t, e) {
                    function n(t, e) {
                        var n = {
                            ev_type: "static",
                            st_type: e
                        }
                            , o = r(t);
                        return n.st_protocol = o.protocol,
                            n.st_domain = o.hostname,
                            n.st_domain ? ("script" !== e && "link" !== e || (n.st_path = o.pathname),
                                "img" !== e || o.pathname && "/" !== o.pathname ? n : null) : null
                    }
                    function o(o) {
                        var r = o || window.event || {}
                            , a = {};
                        try {
                            a = r.target || r.srcElement || {}
                        } catch (r) {
                            return
                        }
                        var i = a.src || a.href || ""
                            , s = a.tagName && a.tagName.toLowerCase() || "";
                        i && s && i !== window.location.href && (e && e.test(i) || t && t(n(i, s)))
                    }
                    window.addEventListener("error", o, !0)
                }
            };
            t.exports = a
        }
        , function(t, e, n) {
            var o = n(0)
                , r = n(6)
                , a = o.getOffsetTop
                , i = o.getWinHeight
                , s = o.now
                , c = r.raf
                , u = r.caf
                , f = {
                start: function(t) {
                    function e() {
                        var i, p;
                        if (f) {
                            if (r.length && !l)
                                for (i = 0; i < r.length; i++) {
                                    if (p = r[i],
                                        !p.complete) {
                                        l = !1;
                                        break
                                    }
                                    l = !0
                                }
                            else
                                l = !0;
                            if (l)
                                return t.__firstScreenLoadEndTime || (t.__firstScreenLoadEndTime = s()),
                                    void u(n)
                        } else {
                            var d = document.querySelectorAll("img");
                            for (i = 0; i < d.length; i++) {
                                p = d[i];
                                var h = a(p);
                                if (h > o) {
                                    f = !0;
                                    break
                                }
                                h <= o && !p.hasPushed && (p.hasPushed = 1,
                                    r.push(p))
                            }
                        }
                        n = c(e)
                    }
                    var n, o = i(), r = [], f = !1, l = !1;
                    n = c(e),
                        document.addEventListener("DOMContentLoaded", function() {
                            document.querySelectorAll("img").length || (f = !0,
                                u(n),
                                e())
                        }),
                        window.addEventListener("load", function() {
                            l = !0,
                                f = !0,
                                u(n),
                                e()
                        }, !1)
                }
            };
            t.exports = f
        }
        , function(t, e) {
            for (var n = 0, o = ["ms", "moz", "webkit", "o"], r = window.requestAnimationFrame, a = window.cancelAnimationFrame, i = 0; i < o.length && !r; ++i)
                r = window[o[i] + "RequestAnimationFrame"],
                    a = window[o[i] + "CancelAnimationFrame"] || window[o[i] + "CancelRequestAnimationFrame"];
            r || (r = function(t, e) {
                    var o = (new Date).getTime()
                        , r = Math.max(0, 16 - (o - n))
                        , a = window.setTimeout(function() {
                        t(o + r)
                    }, r);
                    return n = o + r,
                        a
                }
            ),
            a || (a = function(t) {
                    clearTimeout(t)
                }
            ),
                t.exports = {
                    raf: r,
                    caf: a
                }
        }
        , function(t, e, n) {
            var o = n(0)
                , r = o.isObject
                , a = window.performance
                , i = {
                start: function(t, e) {
                    function n() {
                        var t = {
                            ev_type: "perf"
                        }
                            , n = a.timing;
                        return t.dns = n.domainLookupEnd - n.domainLookupStart,
                            t.tcp = n.connectEnd - n.connectStart,
                            t.request = n.responseStart - n.requestStart,
                            t.response = n.responseEnd - n.responseStart,
                            t.processing = n.domComplete - n.domLoading,
                            t.blank = n.responseEnd - n.navigationStart,
                            t.domready = n.domInteractive - n.navigationStart,
                            t.load = n.loadEventEnd - n.navigationStart,
                            t.firstscreen = e.__firstScreenLoadEndTime ? e.__firstScreenLoadEndTime - n.navigationStart : t.domready,
                            t
                    }
                    function o() {
                        t && t(n())
                    }
                    r(a) && window.addEventListener("load", function() {
                        setTimeout(o, 1500)
                    }, !1)
                }
            };
            t.exports = i
        }
        , function(t, e, n) {
            var o = n(0)
                , r = o.urlParser
                , a = o.now
                , i = window.XMLHttpRequest
                , s = {
                start: function(t, e, n) {
                    function s(n, o) {
                        if (!(e && e.test(o) || 0 === n.ax_status)) {
                            var a = r(o);
                            n.ax_protocol = a.protocol,
                                n.ax_domain = a.hostname,
                                n.ax_path = a.pathname,
                            n.ax_domain && t && t(n)
                        }
                    }
                    function c(t) {
                        var e = "[object String]" === Object.prototype.toString.call(t);
                        return t ? e ? t.length : window.ArrayBuffer && t instanceof ArrayBuffer ? t.byteLength : window.Blob && t instanceof Blob ? t.size : t.length ? t.length : 0 : 0
                    }
                    function u(t, e, n, o, r) {
                        return this._url = e && e.split("?")[0] || "",
                            this._method = t && t.toLowerCase() || "",
                            d.apply(this, arguments)
                    }
                    function f(t) {
                        if (4 === this.readyState) {
                            var e = {
                                ev_type: "ajax",
                                ax_status: this.status,
                                ax_type: this._method
                            };
                            if (200 === this.status)
                                if (e.ax_duration = a() - this._start,
                                "" === this.responseType || "text" === this.responseType)
                                    e.ax_size = c(this.responseText);
                                else if (this.response)
                                    e.ax_size = c(this.response);
                                else
                                    try {
                                        e.ax_size = c(this.responseText)
                                    } catch (t) {}
                            s(e, this._url)
                        }
                        if (this._onreadystatechange)
                            return this._onreadystatechange.apply(this, arguments)
                    }
                    function l(t) {
                        return this.onreadystatechange && (this._onreadystatechange = this.onreadystatechange),
                            this.onreadystatechange = f,
                            this._start = a(),
                            h.apply(this, arguments)
                    }
                    function p(t, e) {
                        function r() {
                            l(function() {
                                s(c, u)
                            })
                        }
                        e = e || {};
                        var i = a()
                            , c = {
                            ev_type: "ajax"
                        }
                            , u = ""
                            , f = "get";
                        t instanceof Request ? (u = t.url,
                            f = t.method) : u = t,
                            u = o.isString(u) ? u.split("?")[0] : u,
                            c.ax_type = (e.method || f).toLowerCase();
                        var l = self.requestIdleCallback || setTimeout;
                        return m.apply(null, arguments).then(function(t) {
                            if (c.ax_status = t.status,
                                c.ax_duration = a() - i,
                                t.headers.has("content-length"))
                                c.ax_size = t.headers.get("content-length") || 0,
                                    r();
                            else {
                                if (n.size)
                                    return l(function() {
                                        t.blob().then(function(t) {
                                            c.ax_size = t.size,
                                                s(c, u)
                                        })
                                    }),
                                        t.clone();
                                c.ax_size = 0,
                                    r()
                            }
                            return t
                        }, function(t) {
                            return c.ax_status = 0,
                                c.ax_size = 0,
                                c.ax_duration = a() - i,
                                r(),
                                Promise.reject(t)
                        })
                    }
                    if ("function" == typeof i) {
                        var d = i.prototype.open
                            , h = i.prototype.send;
                        if (i.prototype.open = u,
                            i.prototype.send = l,
                        "function" == typeof self.fetch && n.fetch && !self.fetch.polyfill && !self.fetch.prototype) {
                            var m = self.fetch;
                            self.fetch = p
                        }
                    }
                }
            };
            t.exports = s
        }
    ])
});
